		TITLE	VIRDEF - Copyright (c) SLR Systems 1991

		INCLUDE	MACROS
		INCLUDE	SYMBOLS
		INCLUDE	SEGMENTS
		INCLUDE	MODULES

		PUBLIC	DEFINE_VIRDEFS

		.DATA

	SOFT	EXTB	PUB_SIZE,PUB_TYPE

	SOFT	EXTW	PUB_CV,CURNMOD_GINDEX,FIRST_VIRDEF_GINDEX,PUB_SEGMOD_GINDEX,PUB_GROUP_GINDEX,MOD_FIRST_PUBLIC_GINDEX

	SOFT	EXTD	PUB_OFFSET

	SOFT	EXTQ	SYMBOL_GARRAY

		.CODE	MIDDLE_TEXT

	SOFT	EXTP	FIX_VIRDEF_ENTRY

		ASSUME	DS:NOTHING

VIRDEF_DONE	PROC
		;
		;OK, TH-TH-TH-THATS ALL
		;
		MOV	CURNMOD_GINDEX,AX
		RET

VIRDEF_DONE	ENDP

DEFINE_VIRDEFS	PROC

		RET

IF 0
		;
		;CHANGE VIRDEFS INTO RELOCS.  STICK SEGMOD IN CORRECT LIST
		;
		RESS	ASEG_FLAG
		XOR	AX,AX
		MOV	PUB_SIZE,AL
		MOV	PUB_GROUP_GINDEX,AX
VIRDEF_NEXT:
		MOV	AX,FIRST_VIRDEF_GINDEX
TEST_VIRDEF:
		OR	AX,AX
		JZ	VIRDEF_DONE
		MOV	CX,AX
		CONVERT_GINDEX_AX_DSSI	SYMBOL_GARRAY
		;
		;LINK SEGMOD IN
		;
		MOV	AX,[SI]._VD_CV_TYPE
		MOV	DX,[SI]._VD_SEGMOD_GINDEX
		MOV	PUB_CV,AX
		MOV	PUB_SEGMOD_GINDEX,DX
		XOR	AX,AX
		MOV	PUB_OFFSET.LW,AX
		MOV	PUB_OFFSET.HW,AX

		LDS	SI,[BX]._VIRDEF_PARENT_SEGMOD
		SYM_CONV_DS
		MOV	AX,DI
		XCHG	[SI]._SM_NEXT_SEGMOD.OFFS,AX
		MOV	DX,ES
		XCHG	[SI]._SM_NEXT_SEGMOD.SEGM,DX
		SYM_CONV_ES_AX
		MOV	ES:[DI]._SM_NEXT_SEGMOD.OFFS,AX
		MOV	ES:[DI]._SM_NEXT_SEGMOD.SEGM,DX
		;
		;NOW DEFINE STUFF NEEDED FOR DOING FIX_VIRDEF
		;
		LDS	SI,[SI]._SM_BASE_SEG	;MOTHER SEGMENT
		SYM_CONV_DS
		LDS	SI,[SI]._SEG_GROUP
		MOV	PUB_GINDEX.OFFS,SI
		MOV	PUB_GINDEX.SEGM,DS

;		LDS	SI,ES:[DI]._SM_PARENT_MOD
		MOV	CURNMOD.OFFS,SI
		MOV	CURNMOD.SEGM,DS
		SYM_CONV_DS
		LDS	SI,[SI]._M_FIRST_PUB
		MOV	MOD_FIRST_PUBLIC.OFFS,SI
		MOV	MOD_FIRST_PUBLIC.SEGM,DS

		MOV	PUB_TYPE,NSYM_RELOC
		MOV	ES,CX
		MOV	DX,CX
		SYM_CONV_ES
		CALL	FIX_VIRDEF_ENTRY	;ES:BX CX IS SYMBOL, DX IS SEGMOD
		MOV	AX,CURNMOD_GINDEX
		CONVERT_GINDEX_AX_DSSI	MODULE_GARRAY
		MOV	AX,MOD_FIRST_PUBLIC_GINDEX
		MOV	[SI]._M_FIRST_PUB_GINDEX
		JMP	VIRDEF_NEXT
ENDIF
DEFINE_VIRDEFS	ENDP

		END

